<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8" />
    <title>我的收藏</title>
    <meta name="viewport"
      content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="../../../../css/mui.min.css" rel="stylesheet" />
    <link href="../../css/common.css" rel="stylesheet" />
    <link href="../../css/helper.css" rel="stylesheet" />
    <style>
      .mui-table-view-cell {
        padding: 0 0;
      }

      .list-item {
        height: 67px;
        border-radius: 3px;
        margin-bottom: 13px;
        background-color: #ffffff;
        padding-left: 16px;
        padding-right: 13px;
      }

      .card-img-box {
        /* margin-right:16px; */
        height: inherit;
        min-width: 33px;
      }

      .card-img {
        width: 33px;
        height: 33px;
      }

      .card-content-box {
        padding: 0 16px;
        width: 70%;
      }

      .txt1 {
        font-size: 14px;
        font-family: PingFang SC;
        font-weight: 500;
        color: #333333;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
      }

      .txt2 {
        font-size: 13px;
        font-family: PingFang SC;
        font-weight: 400;
        color: #999999;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
      }

      .img-tool-box {
        /* height:inherit; */
        width: 60px;
      }

      .img-tool-box .imgs {
        display: inline-block;
        width: 20px;
        height: 20px;
      }

      .img-tool {
        width: 19px;
        height: 19px;
        /* margin-top:10px; */
      }

      .img-19 {
        width: 19px;
        height: 19px;
      }

      .mui-table-view {
        /*margin-top: 44px;*/
        background-color: inherit;
        padding-left: 13px;
        padding-right: 13px;
        padding-top: 13px;
      }

      .mui-table-view-cell:after {
        background-color: #ffffff;
        margin-bottom: 13px;
        background-color: #ffffff;
      }

      .texts {
        text-align: right;
        text-overflow: ellipsis;
        overflow: hidden;
      }

      .mui-pull-bottom-tips {
        text-align: center;
      }

      .mui-pull-top-tips {
        position: absolute;
        top: -20px;
        left: 50%;
        margin-left: -25px;
        width: 40px;
        height: 40px;
        border-radius: 100%;
        z-index: 1;
      }

      .mui-bar~.mui-pull-top-tips {
        top: 24px;
      }

      .mui-pull-top-wrapper {
        width: 42px;
        height: 42px;
        display: block;
        text-align: center;
        background-color: #efeff4;
        border: 1px solid #ddd;
        border-radius: 25px;
        background-clip: padding-box;
        box-shadow: 0 4px 10px #bbb;
        overflow: hidden;
      }

      .mui-pull-top-tips.mui-transitioning {
        -webkit-transition-duration: 200ms;
        transition-duration: 200ms;
      }

      .mui-pull-top-tips .mui-pull-loading {
        /*-webkit-backface-visibility: hidden;
              -webkit-transition-duration: 400ms;
              transition-duration: 400ms;*/
        margin: 0;
      }

      .mui-pull-top-wrapper .mui-icon,
      .mui-pull-top-wrapper .mui-spinner {
        margin-top: 7px;
      }

      .mui-pull-top-wrapper .mui-icon.mui-reverse {
        /*-webkit-transform: rotate(180deg) translateZ(0);*/
      }

      .mui-pull-bottom-tips {
        text-align: center;
        background-color: #efeff4;
        font-size: 15px;
        line-height: 40px;
        color: #777;
      }

      .mui-pull-top-canvas {
        overflow: hidden;
        background-color: #fafafa;
        border-radius: 40px;
        box-shadow: 0 4px 10px #bbb;
        width: 40px;
        height: 40px;
        margin: 0 auto;
      }

      .mui-pull-top-canvas canvas {
        width: 40px;
      }

      .mui-slider-indicator.mui-segmented-control {
        background-color: #fff;
      }

      .silder-wrap {
        height: 60px;
      }

      .mui-fullscreen .mui-segmented-control~.mui-slider-group {
        top: 60px;
      }

      .mui-segmented-control .mui-control-item {
        line-height: 60px;
      }

      .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active {
        color: #3188FE;
        position: relative;
      }

      .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active:after {
        content: '';
        display: block;
        width: 24px;
        height: 3px;
        background: #3188FE;
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
      }
    </style>
  </head>

  <body>
    <div id="container" v-cloak>
      <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">我的收藏</h1>
        <div class="img-tool-boxs">
          <img src="../../img/sousuo.png" class="img-tool fr" style="margin-left: 13px; margin-top: 10px"
            @click="search" />
        </div>
      </header>
      <div class="mui-content app-container">
        <!-- 1、列表 -->
        <div id="slider" class="mui-slider mui-fullscreen">
          <!-- 1、slider items -->
          <div id="sliderSegmentedControl"
            class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted silder-wrap">
            <a class="mui-control-item mui-active" @tap="getType" href="#item1">标准规范库</a>
            <a class="mui-control-item" @tap="getDeviceList" href="#item2">设备资料库</a>
            <a class="mui-control-item" @tap="getTechType" href="#item3">技术交流</a>
            <a class="mui-control-item" @tap="getFaultList" href="#item4">故障案例集</a>
          </div>
          <div class="tab-content mui-slider-group">
            <div id="item1" class="mui-slider-item mui-control-content mui-active">
              <div class="regular-scroll mui-scroll-wrapper">
                <div class="mui-scroll">
                  <ul class="mui-table-view" id="tableitem1">
                    <div class="mui-table-view-cell mui-media list-item f-r-b-c">
                      <div class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-primary">
                        <a class="mui-control-item" v-for="(v,i) in typeList" :key="v.id" :class="i==0?'mui-active':''"
                          href="#item0" @tap="formStand.ids = v.id;getStandList(v.id)">{{v.n}}</a>
                      </div>
                    </div>
                    <li class="mui-table-view-cell mui-media list-item f-r-b-c" v-for="(item,index) in standList"
                      :key="item.id" @tap="detail(item,1)">
                      <div class="card-img-box f-r-c-c">
                        <img src="../../img/word.png" class="card-img" />
                      </div>
                      <div class="card-content-box fs">
                        <div class="txt1">{{item.fn}}</div>
                        <div class="txt2">{{item.c}}</div>
                      </div>
                     <!-- <div class="img-tool-box">
                        <span class="imgs" v-if="item.ic"><img src="../../img/shoucang_yishoucang.png"
                            class="img-tool fr" style="margin-left: 13px" /></span>
                        <span class="imgs" v-else><img src="../../img/shoucang_moren.png" class="img-tool fr"
                            style="margin-left: 13px" /></span><span class="imgs" @tap.stop="downlonds1(item)" style="float: right"><img
                            src="../../img/xiazai.png" class="img-tool fr" style="margin-left: 13px" /></span>
                      </div> -->
                    </li>
                  </ul>
                </div>
              </div>
            </div>
            <div id="item2" class="mui-slider-item mui-control-content">
              <div class="regular-scroll mui-scroll-wrapper">
                <div class="mui-scroll">
                  <ul class="mui-table-view" id="tableitem2">
                    <li class="mui-table-view-cell mui-media list-item f-r-b-c" v-for="(item,index) in deviceList"
                      :key="item.id" @tap="detail(item,2)">
                      <div class="card-img-box f-r-c-c">
                        <img src="../../img/word.png" class="card-img" />
                      </div>
                      <div class="card-content-box fs">
                        <div class="txt1"> {{item.t}}</div>
                        <div class="txt2">{{item.fn}}</div>
                      </div>
                      <div class="img-tool-box">
                        <div class="texts">{{item.cn}}</div>
                        <!-- <span class="imgs" v-if="item.ic"><img src="../../img/shoucang_yishoucang.png"
                            class="img-tool fr" style="margin-left: 13px" /></span>
                        <span class="imgs" v-else><img src="../../img/shoucang_moren.png" class="img-tool fr"
                            style="margin-left: 13px" /></span>
                        <span class="imgs" @tap.stop="downlonds2(item)" style="float: right"><img
                            src="../../img/xiazai.png" class="img-tool fr" style="margin-left: 13px" /></span> -->
                      </div>
                    </li>
                  </ul>
                </div>
              </div>
            </div>
            <div id="item3" class="mui-slider-item mui-control-content">
              <div class="regular-scroll mui-scroll-wrapper">
                <div class="mui-scroll">
                  <ul class="mui-table-view" id="tableitem3">
                    <div class="mui-table-view-cell mui-media list-item f-r-b-c">
                      <div class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-primary">
                        <a class="mui-control-item" v-for="(v,i) in typeTechList" :key="v.id"
                          :class="i==0?'mui-active':''" href="#items0"
                          @tap="formTech.valid = v.value;formTech.typeCodeName = v.label;getTechList()">{{v.label}}</a>
                      </div>
                    </div>
                    <li class="mui-table-view-cell mui-media list-item f-r-b-c" v-for="(item,index) in techList"
                      :key="item.id" @tap="detail(item,3)">
                      <div class="card-img-box f-r-c-c">
                        <img src="../../img/word.png" class="card-img" />
                      </div>
                      <div class="card-content-box fs">
                        <div class="txt1">
                          <span v-if="item.isTop">【置顶】</span>
                          <span v-if="item.isBest">【精华】</span> {{item.t}}
                        </div>
                        <div class="txt2">{{item.cn}}</div>
                      </div>
                      <div class="img-tool-box">
                        <!-- <span class="imgs" v-if="item.ic"><img src="../../img/shoucang_yishoucang.png"
                            class="img-tool fr" style="margin-left: 13px" /></span>
                        <span class="imgs" v-else><img src="../../img/shoucang_moren.png" class="img-tool fr"
                            style="margin-left: 13px" /></span> -->
                      </div>
                    </li>
                  </ul>
                </div>
              </div>
            </div>
            <div id="item4" class="mui-slider-item mui-control-content">
              <div class="regular-scroll mui-scroll-wrapper">
                <div class="mui-scroll">
                  <ul class="mui-table-view" id="tableitem4">
                    <li class="mui-table-view-cell mui-media list-item f-r-b-c" v-for="(item,index) in faultList"
                      :key="item.id" @tap="detail(item,4)">
                      <div class="card-img-box f-r-c-c">
                        <img src="../../img/word.png" class="card-img" />
                      </div>
                      <div class="card-content-box fs">
                        <div class="txt2">{{item.fan}} - {{item.mon}}</div>
                        <div class="txt1">{{item.fn}}</div>
                        <div class="txt2">{{item.cn}}</div>
                      </div>
                      <div class="img-tool-box">
                        <div class="texts">{{item.fc}}</div>
                        <!-- <span class="imgs" v-if="item.ic"><img src="../../img/shoucang_yishoucang.png"
                            class="img-tool fr" style="margin-left: 13px" /></span>
                        <span class="imgs" v-else><img src="../../img/shoucang_moren.png" class="img-tool fr"
                            style="margin-left: 13px" /></span>
                        <span class="imgs" @tap.stop="downlonds4(item)" style="float: right"><img
                            src="../../img/xiazai.png" class="img-tool fr" style="margin-left: 13px" /></span> -->
                      </div>
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <script src="../../../../js/mui.js"></script>
    <script src="../../../../js/mui.pullToRefresh.js"></script>
    <script src="../../../../js/mui.pullToRefresh.material.js"></script>
    <!-- <script src="../../../../js/jquery-1.7.2.min.js"></script> -->
    <script type="text/javascript" src="../../../../js/jquery-3.2.1.min.js"></script>
    <script src="../../../../js/vue.js"></script>
    <script src="../../js/mkeyplus.base.js"></script>
    <script src="../../js/sqlite.js"></script>
    <script type="text/javascript">
      mui.init()
      if (window.plus) {
        plusready()
      } else {
        document.addEventListener("plusready", plusready, false)
      }

      function plusready() {
        mui.DB.openSqlite()
        var self = plus.webview.currentWebview()
        vm.getDeviceList()
        vm.getTechType()
        vm.getFaultList()
        vm.getType()
      }
      var vm = new Vue({
        el: "#container",
        data: {
          form1: {
            page: 1,
            size: 20,
            system: "APP",
            status: 1,
          },
          form2: {
            page: 1,
            size: 20,
            system: "APP",
            status: 1,
          },
          form3: {
            page: 1,
            size: 20,
            system: "APP",
            status: 1,
          },
          form4: {
            page: 1,
            size: 20,
            system: "APP",
            status: 1,
          },
          collets: [{
              id: 1,
              title: "标准规范库",
            },
            {
              id: 2,
              title: "设备资料库",
            },
            {
              id: 3,
              title: "技术交流",
            },
            {
              id: 4,
              title: "故障案例集",
            },
          ],
          type: 1,
          standList: [], //标准
          typeList: [],
          deviceList: [], //设备资料
          techList: [], //技术交流
          typeTechList: [],
          faultList: [], //故障案例
          formStand: {
            ids: "",
          },
          formdevi: {
            areaId: "",
            areaName: "",
          },
          formTech: {
            ids: "",
            valid: "",
            typeCodeName: "",
          },
          formfalt: {
            areaId: "",
            areaName: "",
          },
        },
        created: function() {

        },
        methods: {
          // 标准规范
          getType() {
            this.type = 1
            mui.baseApp.httpRequst(
              "get",
              "/app/api/knowledge/standard/type", {},
              (data) => {
                console.log("dd", data)
                this.typeList = data
                this.formStand.ids = data[0].id
                this.getStandList()
              },
              function() {
                // plus.nativeUI.closeWaiting()
                console.log("获取数据失败")
              }
            )
          },
          getStandList() {
            if (this.form1.page === 1) {
              plus.nativeUI.showWaiting('加载中...');
            }
            mui.baseApp.httpRequst(
              "get",
              "/app/api/knowledge/standard", {
                page: this.form1.page,
                size: this.form1.size,
                classifyCode: this.formStand.ids,
                isCollection: true,
              },
              (data) => {
                console.log("www", data)
                plus.nativeUI.closeWaiting();
                if (this.form1.page == 1) {
                  this.standList = []
                }
                this.standList = this.standList.concat(data.records)
                if (data.records.length < this.form1.size) {
                  //
                  mui("#item1 .mui-scroll")
                    .pullToRefresh()
                    .endPullUpToRefresh(true) //参数为true代表没有更多数据了。
                  return
                } else {
                  mui("#item1 .mui-scroll")
                    .pullToRefresh()
                    .endPullUpToRefresh(false) //参数为true代表没有更多数据了。
                  mui("#item1 .mui-scroll").pullToRefresh().refresh(true) //启用上拉加载
                }
              },
              function() {
                plus.nativeUI.closeWaiting()
                console.log("获取数据失败")
              }
            )
          },
          downlonds1(item) {
            this.getDetils1(item)
          },
          getDetils1(item) {
            let than = this
            let idss = item.id

            mui.baseApp.httpRequst(
              "get",
              "/app/api/knowledge/standard/detail/" + idss, {},
              function(data) {
                console.log("120", data.data)
                let itms = data.data
                // than.details=itms
                let detas = {
                  id: itms.id,
                  knowledgeType: itms.knowledgeType || "",
                  classifyCode: itms.classifyCode || "",
                  fileId: itms.fileId || "",
                  fileName: itms.fileName || "",
                  fileUrl: itms.fileUrl || "",
                  createId: itms.createId || "",
                  createTime: itms.createTime || "",
                  updateId: itms.updateId || "",
                  updateTime: itms.updateTime || "",
                  deleted: itms.deleted || "",
                  createName: itms.createName || "",
                  knowledgeTypeName: itms.knowledgeTypeName || "",
                  classifyCodeName: itms.classifyCodeName || "",
                  fn: item.fn || "",
                  c: item.c || "",
                }
                mui.baseApp.download(
                  itms.fileUrl,
                  itms.fileName,
                  function(res) {
                    console.log("下载文件", res)
                  }
                )
                // let itm= $.extend(than.details,item)
                mui.DB.createFormat("dataStand", detas, "id")
                mui.DB.insertOrReplace("dataStand", detas)
              },
              function() {
                // plus.nativeUI.closeWaiting()
                console.log("获取数据失败1")
              }
            )
          },
          // 设备资料
          getDeviceList() {
            this.type = 2
            // this.ids=id;
            if (this.form2.page === 1) {
              plus.nativeUI.showWaiting('加载中...');
            }
            mui.baseApp.httpRequst(
              "get",
              "/app/api/knowledge/equipment", {
                page: this.form2.page,
                size: this.form2.size,
                isCollection: true,
                areaId: this.formdevi.areaId,
                areaName: this.formdevi.areaName,
                // stationId:stationId,
                // stationName:stationName,
                // classifyCode:id,
              },
              (data) => {
                console.log("www", data)
                plus.nativeUI.closeWaiting();
                if (this.form2.page == 1) {
                  this.deviceList = []
                }
                this.deviceList = this.deviceList.concat(data.records)
                if (data.records.length < this.form2.size) {
                  //
                  mui("#item2 .mui-scroll")
                    .pullToRefresh()
                    .endPullUpToRefresh(true) //参数为true代表没有更多数据了。
                  return
                } else {
                  mui("#item2 .mui-scroll")
                    .pullToRefresh()
                    .endPullUpToRefresh(false) //参数为true代表没有更多数据了。
                  mui("#item2 .mui-scroll").pullToRefresh().refresh(true) //启用上拉加载
                }
              },
              function() {
                plus.nativeUI.closeWaiting()
                console.log("获取数据失败")
              }
            )
          },
          downlonds2(item) {
            console.log("123", item)
            this.getDetils2(item)
          },
          getDetils2(item) {
            let than = this
            let ids = item.id
            mui.baseApp.httpRequst(
              "post",
              "/app/api/knowledge/equipment/detail/" + ids, {},
              function(data) {
                console.log("12qq", data.data)
                let itms = data.data
                // than.detils=itms
                let detas = {
                  id: itms.id,
                  areaId: itms.areaId || "",
                  areaName: itms.areaName || "",
                  deviceModelId: itms.deviceModelId || "",
                  deviceModelIds: itms.deviceModelIds || "",
                  deviceModelName: itms.deviceModelName || "",
                  machineModel: itms.machineModel || "",
                  functionalLocation: itms.functionalLocation || "",
                  title: itms.title || "",
                  fileId: itms.fileId || "",
                  fileAddres: itms.fileAddres || "",
                  createId: itms.createId || "",
                  createName: itms.createName || "",
                  createTime: itms.createTime || "",
                  deleted: itms.deleted || "",
                  dm: item.dm || "",
                  t: item.t || "",
                  fn: item.fn || "",
                  cn: item.cn || "",
                }
                // let itm= $.extend(than.details,item)
                mui.DB.createFormat("dataDevice", detas, "id")
                mui.DB.insertOrReplace("dataDevice", detas)
                // plus.nativeUI.closeWaiting();
              },
              function() {
                plus.nativeUI.closeWaiting()
                console.log("获取数据失败1")
              }
            )
          },
          // 技术交流
          getTechType() {
            this.type = 3
            mui.baseApp.httpRequst(
              "post",
              "/app/sys/dictItem/getDictDetail", {
                dictName: "Format"
              },
              (data) => {
                console.log("dd", data)
                this.typeTechList = data.data
                this.formTech.ids = this.typeTechList[0].id
                this.formTech.valid = this.typeTechList[0].value
                this.formTech.typeCodeName = this.typeTechList[0].label
                this.getTechList()
              },
              function() {
                // plus.nativeUI.closeWaiting()
                console.log("获取数据失败")
              }
            )
          },
          getTechList() {
            if (this.form3.page === 1) {
              plus.nativeUI.showWaiting('加载中...');
            }
            mui.baseApp.httpRequst(
              "get",
              "/app/api/knowledge/experience", {
                page: this.form3.page,
                size: this.form3.size,
                typeCode: this.formTech.valid,
                isCollection: true,
              },
              (data) => {
                console.log("www", data)
                plus.nativeUI.closeWaiting();
                if (this.form3.page == 1) {
                  this.techList = []
                }
                this.techList = this.techList.concat(data.records)
                if (data.records.length < this.form3.size) {
                  //
                  mui("#item3 .mui-scroll")
                    .pullToRefresh()
                    .endPullUpToRefresh(true) //参数为true代表没有更多数据了。
                  return
                } else {
                  mui("#item3 .mui-scroll")
                    .pullToRefresh()
                    .endPullUpToRefresh(false) //参数为true代表没有更多数据了。
                  mui("#item3 .mui-scroll").pullToRefresh().refresh(true) //启用上拉加载
                }
              },
              function() {
                plus.nativeUI.closeWaiting()
                console.log("获取数据失败")
              }
            )
          },
          // 故障案例
          getFaultList() {
            this.type = 4
            // this.ids=id;
            if (this.form4.page === 1) {
              plus.nativeUI.showWaiting('加载中...');
            }
            mui.baseApp.httpRequst(
              "get",
              "/app/api/knowledge/faultCase", {
                page: this.form4.page,
                size: this.form4.size,
                isCollection: true,
              },
              (data) => {
                console.log("www", data)
                plus.nativeUI.closeWaiting();
                if (this.form4.page == 1) {
                  this.faultList = []
                }
                this.faultList = this.faultList.concat(data.records)
                if (data.records.length < this.form4.size) {
                  //
                  mui("#item4 .mui-scroll")
                    .pullToRefresh()
                    .endPullUpToRefresh(true) //参数为true代表没有更多数据了。
                  return
                } else {
                  mui("#item4 .mui-scroll")
                    .pullToRefresh()
                    .endPullUpToRefresh(false) //参数为true代表没有更多数据了。
                  mui("#item4 .mui-scroll").pullToRefresh().refresh(true) //启用上拉加载
                }
              },
              function() {
                plus.nativeUI.closeWaiting()
                console.log("获取数据失败")
              }
            )
          },
          downlonds4(item) {
            console.log("123", item)
            this.getDetils(item)
          },
          getDetils4(item) {
            let than = this
            let ids = item.id
            mui.baseApp.httpRequst(
              "post",
              "/app/api/knowledge/faultCase/detail/" + ids, {},
              function(data) {
                console.log("12故障", data.data)
                let ites = data.data
                // than.detils=data.data
                // plus.nativeUI.closeWaiting();
                let detas = {
                  id: ites.id,
                  deviceModelId: ites.deviceModelId || "",
                  deviceModelIds: ites.deviceModelIds || "",
                  deviceModelName: ites.deviceModelName || "",
                  manufactor: ites.manufactor || "",
                  machineModel: ites.machineModel || "",
                  faultName: ites.faultName || "",
                  faultCode: ites.faultCode || "",
                  title: ites.title || "",
                  fileId: ites.fileId || "",
                  fileAddres: ites.fileAddres || "",
                  fileDescribe: ites.fileDescribe || "",
                  createId: ites.createId || "",
                  createName: ites.createName || "",
                  createTime: ites.createTime || "",
                  deleted: ites.deleted || "",
                  fan: item.fan || "",
                  mon: item.mon || "",
                  fn: item.fn || "",
                  cn: item.cn || "",
                  fc: item.fc || "",
                }
                console.log("aaaaaaaa", detas)
                mui.DB.createFormat("dataFaults", detas, "id")
                mui.DB.insertOrReplace("dataFaults", detas)
              },
              function() {
                // plus.nativeUI.closeWaiting()
                console.log("获取数据失败1")
              }
            )
          },
          detail(item, type) {
            if (type == 1) {
              mui.baseApp.openWindow("../standard/detail.html", {
                ids: item.id,
                type: type,
              })
            } else if (type == 2) {
              mui.baseApp.openWindow("../device/detail.html", {
                ids: item.id,
                type: type,
              })
            } else if (type == 3) {
              mui.baseApp.openWindow("../technology/detail.html", {
                ids: item.id,
                type: type,
              })
            } else if (type == 4) {
              mui.baseApp.openWindow("../faultCase/detail.html", {
                ids: item.id,
                type: type,
              })
            }
          },
          search() {
            mui.baseApp.openWindow("../../common/search.html", {
              type: this.type,
            })
          },
          searchadd() {
            mui.baseApp.openWindow({
              url: "./add.html",
            })
          },
        },
      });
      (function($) {
        //阻尼系数
        var deceleration = mui.os.ios ? 0.003 : 0.0009;
        $('.mui-scroll-wrapper').scroll({
          bounce: false,
          indicators: true, //是否显示滚动条
          deceleration: deceleration
        });
        $.ready(function() {
          //循环初始化所有下拉刷新，上拉加载。
          $.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
            $(pullRefreshEl).pullToRefresh({
              down: {
                callback: function() {
                  var self = this;
                  setTimeout(function() {
                    if (index === 0) {
                      vm.form1.page = 1
                      vm.getStandList()
                    } else if (index === 1) {
                      vm.form2.page = 1
                      vm.getDeviceList()
                    } else if (index === 2) {
                      vm.form3.page = 1
                      vm.getTechList()
                    } else {
                      vm.form4.page = 1
                      vm.getFaultList()
                    }
                    self.endPullDownToRefresh();
                  }, 500);

                }
              },
              up: {
                callback: function() {
                  var self = this;
                  setTimeout(function() {
                    if (index === 0) {
                      vm.form1.page++
                      vm.getStandList()
                    } else if (index === 1) {
                      vm.form2.page++
                      vm.getDeviceList()
                    } else if (index === 2) {
                      vm.form3.page++
                      vm.getTechList()
                    } else {
                      vm.form4.page++
                      vm.getFaultList()
                    }
                    self.endPullUpToRefresh();
                  }, 500);
                }
              }
            });
          });
          mui("#item1 .mui-scroll").pullToRefresh().endPullUpToRefresh(true);
          //        mui("#item2 .mui-scroll").pullToRefresh().endPullUpToRefresh(true);
        });
      })(mui);

      document.getElementById('slider').addEventListener('slide', function(e) {
        console.log(e.detail.slideNumber);
        vm.type = e.detail.slideNumber + 1
      });

      window.addEventListener('collection', function(event) {
        let data = event.detai
        const index = vm.type
        if (data.isCollection == undefined) {
          return
        }
        if (index === 0) {
          vm.form1.page = 1
          vm.getStandList()
        } else if (index === 1) {
          vm.form2.page = 1
          vm.getDeviceList()
        } else if (index === 2) {
          vm.form3.page = 1
          vm.getTechList()
        } else {
          vm.form4.page = 1
          vm.getFaultList()
        }
      });
    </script>
  </body>

</html>
